package cn.juque.redoctopus.client.util;

import java.net.InetAddress;
import lombok.extern.slf4j.Slf4j;

/**
 * @author nuoka
 * @version 1.0.0
 * <li>IntelliJ IDEA</li>
 * <li></li>
 * @date 2021/8/29 13:05
 **/
@Slf4j
public class IpUtil {

    private IpUtil() {
    }

    public static String ip4Address() {
        try {
            InetAddress ip = InetAddress.getLocalHost();
            return ip.getHostAddress();
        } catch (Exception e) {
            log.error("get ipv4 error", e);
            return null;
        }
    }
}
